<!DOCTYPE html>
<html lang="zh-CN">
  <head>
      <meta charset="UTF-8">
      <title>本地 YUM 私有仓库</title>
      <style>
          body {
              font-family: Arial, sans-serif;
              background-color: #f9f9f9;
              color: #333;
              margin: 20px;
              line-height: 1.6;
          }
          h1, h2 {
              color: #008080;
          }
          h1 {
              border-bottom: 2px solid #008080;
              padding-bottom: 10px;
          }
          h2 {
              margin-top: 30px;
          }
          pre {
              background-color: #f4f4f4;
              border: 1px solid #ccc;
              padding: 10px;
              border-radius: 5px;
              overflow: auto;
          }
          .section {
              margin-bottom: 20px;
              padding: 15px;
              background-color: #fff;
              border: 1px solid #ddd;
              border-radius: 5px;
              box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
              transition: transform 0.2s, box-shadow 0.2s;
          }
          .section:hover {
              transform: translateY(-5px);
              box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
          }
          ol {
              margin-left: 20px;
          }
          p {
              margin: 10px 0;
          }
      </style>
  </head>
  <body>
      <h1>YUM 源配置指南</h1>
  
      <div class="section">
          <h2>YUM 仓库清单</h2>
         <tr><td class="link"><a href="http://192.168.18.127/centos" title="centos7">centos7-x86</a><br/></td></tr>
         <tr><td class="link"><a href="http://192.168.18.127/epel/epel" title="epel">centos7-epel-x86</a><br/></td></tr>
         <tr><td class="link"><a href="http://192.168.18.127/docker-ce/docker-ce" title="docker-ce-x86">docker-ce/</a><br/></td></tr>
         <tr><td class="link"><a href="http://192.168.18.127/kubernetes/kubernetes" title="kubernetes-x86">kubernetes/</a><br/></td></tr>
      </div>
  
      <div class="section">
          <h2>快速配置</h2>
          <p>使用下面的命令，可以直接下载 repo 文件。</p>
          <pre>curl -o /etc/yum.repos.d/localyum.repo http://192.168.18.127/localyum.repo</pre>
      </div>
  
      <div class="section">
          <h2>配置文件示例</h2>
          <p>要配置 YUM 源，请在 <code>/etc/yum.repos.d/</code> 目录下创建一个 <code>.repo</code> 扩展名的文件。下面是私有仓库的完整内容：</p>
          <pre>
[centos_base]
name=source_from_localserver
baseurl=http://192.168.18.127/centos/base/Packages
gpgcheck=0
enable=1

[centos_extras]
name=source_from_localserver
baseurl=http://192.168.18.127/centos/extras/Packages
gpgcheck=0
enable=1

[centos_updates]
name=source_from_localserver
baseurl=http://192.168.18.127/centos/updates/Packages
gpgcheck=0
enable=1

[epel]
name=source_from_localserver
baseurl=http://192.168.18.127/epel/epel/Packages
gpgcheck=0
enable=1

[kubernetes]
name=source_from_localserver
baseurl=http://192.168.18.127/kubernetes/kubernetes/Packages
gpgcheck=0
enable=1
</pre>
          <p>复制上述内容。</p>
          <p>将其保存为 <code>/etc/yum.repos.d/localyum.repo</code> 文件。</p>
      </div>
  
      <div class="section">
          <h2>更新 YUM 仓库</h2>
          <p>验证仓库</p>
          <pre>
yum repolist
</pre>
          <p>清除缓存</p>
          <pre>
yum clean all
</pre>
          <p>生成缓存</p>
          <pre>
yum makecache
</pre>
      </div>
  </body>
</html>

